package list;


public class TestLinkedList {
    public static void test1(){
        MyLinkedList list = new MyLinkedList();
        list.addFirst("a");
        list.addFirst("b");
        list.addFirst("c");
        list.addFirst("d");
        System.out.println(list);
    }
    public static void test2(){
        MyLinkedList list = new MyLinkedList();
        list.addFirst("x");
        list.addLast("a");
        list.addLast("b");
        list.addLast("c");
        list.addLast("d");
        System.out.println(list);
    }
    public static void test3(){
        MyLinkedList list = new MyLinkedList();
        list.addFirst("a");
        list.addFirst("b");
        list.addFirst("c");
        list.addFirst("d");
        System.out.println(list);
        list.add(1,"x");
        System.out.println(list);
        list.add(5,"p");
        System.out.println(list);
        list.add(0,"n");
    }
    public static void test4(){
        MyLinkedList list = new MyLinkedList();
        list.addFirst("x");
        list.addLast("a");
        list.addLast("b");
        list.addLast("c");
        list.addLast("d");
        System.out.println(list);
        System.out.println(list.contains("c"));
        System.out.println(list.contains("w"));
        System.out.println(list.indexOf("d"));
        System.out.println(list.indexOf("w"));
    }
    public static void test5(){
        MyLinkedList list = new MyLinkedList();
        list.addLast("a");
        list.addLast("b");
        list.addLast("c");
        list.addLast("d");
        System.out.println(list);
        System.out.println(list.remove("a"));
        System.out.println(list);
        System.out.println(list.remove(0));
        System.out.println(list);
    }
    public static void test6(){
        MyLinkedList list = new MyLinkedList();
        list.addFirst("a");
        list.addFirst("b");
        list.addFirst("c");
        list.addFirst("d");
        list.add(1,"x");
        list.add(5,"p");
        list.add(0,"n");
        list.clean();
        System.out.println(list);
    }
    public static void main(String[] args) {
        test1();
        test2();
        test3();
        test4();
        test5();
        test6();
    }
}
